<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:70:"D:\Apache24\htdocs\chenxiangyu/application/ebcms\view\oplog\index.html";i:1488165822;s:72:"D:\Apache24\htdocs\chenxiangyu/application/ebcms\view\common\header.html";i:1488098063;s:72:"D:\Apache24\htdocs\chenxiangyu/application/ebcms\view\common\footer.html";i:1482201112;}*/ ?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <title>后台管理系统</title>
    <script type="text/javascript" src="__ROOT__/system/js/jquery.min.js"></script>
    <!-- Bootstrap -->
    <link href="__ROOT__/third/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 flowers of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]]
    <script src="http://static.ebcms.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://static.ebcms.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="__ROOT__/third/bootstrap/js/bootstrap.min.js"></script>
    <!-- artDialog -->
    <script type="text/javascript" src="__ROOT__/third/artDialog/jquery.artDialog.js"></script>
    <link rel="stylesheet" type="text/css" href="__ROOT__/third/artDialog/skins/default.css">
    <script type="text/javascript" src="__ROOT__/third/artDialog/artDialog.ext.js"></script>
    <!-- 引入后台样式表 -->
    <link rel="stylesheet" type="text/css" href="__ROOT__/system/css/admin.css">
    <script type="text/javascript" src="__ROOT__/system/js/admin.js"></script>
    <script>
        $(function() {

            // 动作绑定
            $('.ebcms-do').bind('click', function(event) {
                var $this  = $(this);
                if ($this.attr('confirm')) {
                    EBCMS.MSG.confirm($this.attr('confirm'),function(){
                        EBCMS.CORE.do({
                            method:$this.attr('method'),
                            url:$this.attr('url'),
                            data:$this.data()
                        });
                    });
                }else{
                    EBCMS.CORE.do({
                        method:$this.attr('method'),
                        url:$this.attr('url'),
                        data:$this.data()
                    });
                }
            });
            $('.ebcms-go').bind('click', function(event) {
                var $this  = $(this);
                if ($this.attr('confirm')) {
                    EBCMS.MSG.confirm($this.attr('confirm'),function(){
                        location.href=$this.attr('url');
                    });
                }else{
                    location.href=$this.attr('url');
                }
            });
            $('.ebcms-change').each(function(index, el) {
                $(this).data('value',$(this).val());
            });
            $('.ebcms-refresh').bind('click', function(event) {
                location = location;
                return false;
            });
            $('.ebcms-overflow').each(function(index, el) {
                $(this).width($(this).parent().width()-10);
            });
            $('.ebcms-overflow').bind('dblclick', function(event) {
                if ($(this).width() < 200) {
                    var maxwidth = $(window).width()/2;
                    art.dialog({
                        id:'tips',
                        title:'信息预览',
                        lock: false,
                        fixed: false,
                        drag: true,
                    }).content('<div style="max-width:'+maxwidth+'px;">'+$(this).html()+'</div>').show();
                }else{
                    if ($(this).css('overflow') == 'auto') {
                        $(this).css({
                            'overflow': 'hidden',
                            'white-space': 'nowrap'
                        });
                    }else{
                        $(this).css({
                            'overflow': 'auto',
                            'white-space': 'normal'
                        });
                    }
                }
            });
            $('.ebcms-change').change(function() {
                var $this  = $(this);
                if ($this.attr('confirm')) {
                    EBCMS.MSG.confirm($this.attr('confirm'),function(){
                        $this.data('value', $this.val());
                        EBCMS.CORE.do({
                            url:$this.attr('url'),
                            data:$this.data()
                        });
                    },function(){
                        $this.val($this.data('value'));
                    });
                }else{
                    $this.data('value', $this.val());
                    EBCMS.CORE.do({
                        url:$this.attr('url'),
                        data:$this.data()
                    });
                }
            });
        });
    </script>
</head>
<body>
<div class="col-md-12">
    <h3>
        <span>操作日志</span>
    </h3>
    <div class="table-responsive">
        <table class="table table-bordered table-hover table-ebcms">
            <tbody>
                <tr>
                    <th style="width:70px;">id</th>
                    <th style="width:90px;">操作</th>
                    <th>用户</th>
                    <th>说明</th>
                    <th>时间</th>
                    <th>地址</th>
                    <th>IP</th>
                </tr>
                <?php 
                    $where = [];
                    $data = \app\ebcms\model\Oplog::with('manager') -> where($where) -> order('id desc') -> paginate(10,false,['query'=>input('get.')]);
                 if(is_array($data) || $data instanceof \think\Collection): if( count($data)==0 ) : echo "" ;else: foreach($data as $key=>$vo): ?>
                    <tr>
                        <td>
                            <label>
                                <input type="checkbox" class="ebcms-id" name="id" value="<?php echo $vo['id']; ?>">
                                <?php echo $vo['id']; ?>
                            </label>
                        </td>
                        <td>
                            <?php if(check_auth('delete')): ?>
                                <button type="button" class="btn btn-primary btn-sm ebcms-do" url="<?php echo url('delete'); ?>" data-ids='<?php echo $vo['id']; ?>' confirm="删除后不可恢复，确定删除？"><span class="glyphicon glyphicon-remove"></span></button>
                            <?php endif; if(check_auth('detail')): ?>
                                <a href="<?php echo url('chenxiangy/oplog/detail',['id'=>$vo['id']]); ?>" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-eye-open"></span></a>
                            <?php endif; ?>
                        </td>
                        <td><?php echo $vo['manager']['nickname']; ?></td>
                        <td><?php echo $vo['title']; ?></td>
                        <td><?php echo date('Y-m-d H:i:s',$vo['create_time']); ?></td>
                        <td><?php echo $vo['url']; ?></td>
                        <td><?php echo $vo['ip']; ?></td>
                    </tr>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
            <tfoot>
                <tr>
                    <td style="cursor: pointer;" onclick="$('input.ebcms-id').trigger('click');">
                        <span class="glyphicon glyphicon-check"></span> 选择
                    </td>
                    <td colspan="6">
                        <button onclick="$(this).data('ids',EBCMS.FN.getCheckedId('input.ebcms-id:checkbox:checked'));" type="button" class="btn btn-danger btn-sm ebcms-do" url="<?php echo url('delete'); ?>" confirm="批量删除选中项吗？">删除</button>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
    <?php echo $data -> render(); ?>
</div>
</body>
</html>